<?php
	header("Content-Type: text/html; charset=utf-8");
	require_once(dirname(__FILE__) . '/' . 'SQLOperation.class.php');
	
	$db = new SQLOperation("localhost", "test");
	if ($db->connect()) {
		$account = $_POST['account'];
		$hospital = $_POST['hospital'];
		$office = $_POST['office'];
		$result = $db->update("server", 
				"hospital='".$hospital."',"."office='".$office."'", 
				"account='".$account."'");
		if ($result) {				
			$arr = array("code"=>0, "msg"=>"更新成功");
			echo json_encode($arr);
		} else {
			$arr = array("code"=>100, "msg"=>mysql_error());
			echo json_encode($arr);
		}
	
		$db->close();
	} else {
		$arr = array("code"=>100, "msg"=>mysql_error());
		echo json_encode($arr);
	}
?>